import { _decorator, Component, Vec2, CCBoolean, UITransform } from 'cc';
const {ccclass, property} = _decorator;

@ccclass('PolygonNavPolygon')
export default class PolygonNavPolygon extends Component {
  	
    @property({type:Vec2 , tooltip:"需要顺时针编辑,借助PolygonCollider2D编辑"})
    Points: Vec2[]=[];

    @property(UITransform)
    Trans: UITransform = null;

    @property(CCBoolean)
    IsBorder: boolean = false;

    public GetPoints():Vec2[]
    {
        if(this.IsBorder)
        {
			var newArr:Vec2[] = [];
            for (let index = this.Points.length - 1; index >= 0; index--) {
                newArr.push(this.Points[index]);
            }
            return newArr;
        }
        return this.Points;
    }
}

